<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
  		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>个人申请进度</title>
		<link rel="stylesheet" type="text/css" href="../../static/admin/layui/css/layui.css"/>
		<link rel="stylesheet" type="text/css" href="../../static/admin/css/admin.css"/>
		<script src="../../../../src/static/jquery.js"></script>
		<style>
			#name1,#name2,#name3,#zt,#xn{color: black}
		</style>

	</head>
	<body>
		<div class="layui-tab page-content-wrap">
		  <ul class="layui-tab-title">
		    <li class="layui-this">申请进度</li>
		  </ul>
		  <div class="layui-tab-content">
		    <div class="layui-tab-item layui-show">
		    	<form class="layui-form"  style="width: 90%;padding-top: 20px;">
				  <div class="layui-form-item">
				    <label class="layui-form-label">公司名称：</label>
				    <div class="layui-input-block">
				      <input type="text" id="name1" disabled autocomplete="off" class="layui-input" >
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">手机号码：</label>
				    <div class="layui-input-block">
				      <input type="text" id="name2" disabled autocomplete="off" class="layui-input" >
				    </div>
				  </div>
				   <div class="layui-form-item">
				    <label class="layui-form-label">存放地址：</label>
				    <div class="layui-input-block">
						<textarea id="name3" disabled class="layui-textarea"></textarea>
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">申请进度：</label>
				    <div class="layui-input-block">
				      <input type="text" id="zt"  disabled autocomplete="off" class="layui-input" >
				    </div>
				  </div>
				  <div class="layui-form-item layui-form-text" id="yx" style="display: none">
				    <label class="layui-form-label">失败原因：</label>
				    <div class="layui-input-block">
				      <textarea id="xn" disabled class="layui-textarea"></textarea>
				    </div>
				  </div>
				</form>
		    </div>
		  </div>
		</div>
	<script src="../../static/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
	<script>
		layui.use(['form','element'], function(){
		  var form = layui.form();
		});


        $.ajax(
            {
                url: '/api/getCompanyByphone',
                type: 'get',
                dataType: 'json',
                success: function (data) {
                    if(data.code == 0){
                        $('#name1').val(data.data.companyName);
                        $('#name2').val(data.data.phone);
                        $('#name3').val(data.data.depositAddress);
                        if (data.data.status == 0) {
                            $('#zt').val("审核中...");
                        } else if (data.data.status == 1) {
                            $('#zt').val("申请已通过");
                        } else if (data.data.status == 2) {
                            $('#zt').val("申请未通过");
                        }

                        if (data.data.status == 2) {
                            $("#yx").show();
                            var str = "";
                            var arr = data.data.reason;

                            var result = arr.split(",");
                            for (var i = 0; i < result.length; i++) {
                                if (result[i] == 1) {
                                    $('#xn').append("公司外景不清晰；\n" );
                                } else if (result[i] == 2) {
                                    $('#xn').append("公司内景照不清晰；\n");
                                } else if (result[i] == 3) {
                                    $('#xn').append("法人身份证与营业执照不一致；\n" );
                                } else if (result[i] == 4) {
                                    $('#xn').append("公司名称与营业执照不一致；\n");
                                } else if(result[i] == 5){
                                    $('#xn').append("公司地址与营业执照不一致；");
								}
                            }
                        }
					}else if(data.code == 1) {
                        layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg(data.msg);
                        });
					}else if (data.code == 2) {
                        layui.use('layer', function(){
                            var layer = layui.layer;
                            layer.msg(data.msg);
                        });
					}
                }
            });
	</script>
	</body>
</html>